package com.itheima.microservice.service1.service;


import com.itheima.microservice.service1.api.ConsumerService;
import com.itheima.microservice.service2.api.ProviderService;

/**
 * @author Administrator
 * @version 1.0
 **/
//本类实现service-1的接口ConsumerService
@org.apache.dubbo.config.annotation.Service //注解标记此类的方法暴露为dubbo接口
public class ConsumerServiceImpl implements ConsumerService {
    //注入service  基于dubbo协议
    @org.apache.dubbo.config.annotation.Reference  //生成接口代理对象，通过代理对象进行远程调用
    ProviderService providerService;

    //dubbo接口实现的内容
    public String service() {
        String service2 = providerService.service();
        return "service1被调用: consumer invoke" + "|" + service2;
    }
}
